package com.gui.spring.aop.base;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

public class AopDemo1 {

    public static void main(String[] args) {

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);
        Arrays.stream(context.getBeanDefinitionNames()).filter(item -> !item.startsWith("org.")).forEach(System.out::println);
        // class com.gui.spring.aop.base.Service01$$EnhancerBySpringCGLIB$$b3c23c4e
        Service01 service01 = context.getBean(Service01.class);
        System.out.println(service01.getClass());
        service01.foo(1);
    }
}
